//  Demonstrates the difference between comparing primitive data and objects using wrapper classes

public class Objects
{
   public static void main (String[] args)
   {
      int x, y;
      Integer a, b;
      
      x = 5;
      y = 5;
      System.out.println("x = " + x + ",  y = " + y + ", x == y is " + (x == y));
      
      a = new Integer(5); 
//    a = 5;   // comment the previous line and uncomment this one. Does the output change?
      b = new Integer(5);
//    b = 5;   // comment the previous line and uncomment this one. Does the output change?
      System.out.println("a = " + a + ",  b = " + b + ", a == b is " + (a == b));
      System.out.println("a = " + a + ",  b = " + b + ", a.equals(b) is " + a.equals(b));
      
   }
}

